home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / graphics / frxtract / frxdir.frm next >
Text File  |  1995-11-15  |  4KB  |  172 lines

  1. VERSION 2.00
  2. Begin Form frmDirectory 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Select A Directory"
  6.    ClientHeight    =   3885
  7.    ClientLeft      =   1785
  8.    ClientTop       =   3060
  9.    ClientWidth     =   2880
  10.    ClipControls    =   0   'False
  11.    FontBold        =   0   'False
  12.    FontItalic      =   0   'False
  13.    FontName        =   "Courier"
  14.    FontSize        =   9.75
  15.    FontStrikethru  =   0   'False
  16.    FontTransparent =   0   'False
  17.    FontUnderline   =   0   'False
  18.    ForeColor       =   &H00000000&
  19.    Height          =   4290
  20.    Icon            =   0
  21.    Left            =   1725
  22.    LinkMode        =   1  'Source
  23.    LinkTopic       =   "Form1"
  24.    MaxButton       =   0   'False
  25.    ScaleHeight     =   259
  26.    ScaleMode       =   3  'Pixel
  27.    ScaleWidth      =   192
  28.    Tag             =   "IconWrks Viewer"
  29.    Top             =   2715
  30.    Width           =   3000
  31.    Begin CommandButton cmdClose 
  32.       Caption         =   "&Close"
  33.       FontBold        =   0   'False
  34.       FontItalic      =   0   'False
  35.       FontName        =   "MS Sans Serif"
  36.       FontSize        =   8.25
  37.       FontStrikethru  =   0   'False
  38.       FontUnderline   =   0   'False
  39.       Height          =   375
  40.       Left            =   1110
  41.       TabIndex        =   5
  42.       Top             =   3390
  43.       Width           =   1665
  44.    End
  45.    Begin Frame fraPath 
  46.       BackColor       =   &H00C0C0C0&
  47.       Height          =   3255
  48.       Left            =   60
  49.       TabIndex        =   0
  50.       Top             =   30
  51.       Width           =   2715
  52.       Begin DirListBox dirList 
  53.          FontBold        =   0   'False
  54.          FontItalic      =   0   'False
  55.          FontName        =   "MS Sans Serif"
  56.          FontSize        =   8.25
  57.          FontStrikethru  =   0   'False
  58.          FontUnderline   =   0   'False
  59.          Height          =   2055
  60.          Left            =   120
  61.          TabIndex        =   1
  62.          Top             =   510
  63.          Width           =   2505
  64.       End
  65.       Begin DriveListBox drvList 
  66.          FontBold        =   0   'False
  67.          FontItalic      =   0   'False
  68.          FontName        =   "MS Sans Serif"
  69.          FontSize        =   8.25
  70.          FontStrikethru  =   0   'False
  71.          FontUnderline   =   0   'False
  72.          Height          =   315
  73.          Left            =   120
  74.          TabIndex        =   2
  75.          Top             =   2820
  76.          Width           =   2505
  77.       End
  78.       Begin Label zlblDirs 
  79.          BackStyle       =   0  'Transparent
  80.          Caption         =   "&Directories:"
  81.          Height          =   210
  82.          Left            =   120
  83.          TabIndex        =   3
  84.          Top             =   240
  85.          Width           =   1365
  86.       End
  87.       Begin Label zlblDrives 
  88.          BackStyle       =   0  'Transparent
  89.          Caption         =   "Dri&ves:"
  90.          Height          =   210
  91.          Left            =   120
  92.          TabIndex        =   4
  93.          Top             =   2580
  94.          Width           =   1365
  95.       End
  96.    End
  97. End
  98. Option Explicit
  99.  
  100. Sub cmdClose_Click ()
  101.   
  102.   ' unload form
  103.   Unload Me
  104.  
  105. End Sub
  106.  
  107. Sub dirList_Change ()
  108.   
  109.   ' change to selected directory
  110.   ChDir dirList.Path
  111.   
  112. End Sub
  113.  
  114. Sub dirList_KeyPress (KeyAscii As Integer)
  115.  
  116.   ' change path with enter
  117.   If KeyAscii = 13 Then
  118.     dirList.Path = dirList.List(dirList.ListIndex)
  119.   End If
  120.  
  121. End Sub
  122.  
  123. Sub drvList_Change ()
  124.  
  125.  ' Description:
  126.  '  Check if drive is ready
  127.     
  128.  ' Variables
  129.   Dim s1 As String
  130.  
  131.   ' handle errors
  132.   On Error Resume Next
  133.   Err = False
  134.  
  135.   ' make error happen
  136.   s1 = Dir$(Left$(drvList.Drive, 2))
  137.  
  138.   ' if drive was not ready
  139.   If Err Then
  140.     MsgBox Error, MB_ICONSTOP
  141.     drvList.Drive = Left$(dirList.Path, 2)
  142.   
  143.   ' if OK
  144.   Else
  145.     ChDrive drvList.Drive
  146.     dirList.Path = CurDir$
  147.   End If
  148.  
  149. End Sub
  150.  
  151. Sub Form_Unload (Cancel As Integer)
  152.  
  153.  ' Variables:
  154.   Dim n1 As Integer
  155.   Dim s1 As String
  156.  
  157.   ' see if selected path already in combo box
  158.   s1 = UCase$(dirList.Path)
  159.   For n1 = 0 To frmExtract!cboOther.ListCount - 1
  160.     If s1 = frmExtract!cboOther.List(n1) Then
  161.       frmExtract!cboOther.ListIndex = n1
  162.       Exit Sub
  163.     End If
  164.   Next n1
  165.  
  166.   ' add item and set to that item
  167.   frmExtract!cboOther.AddItem s1, 0
  168.   frmExtract!cboOther.ListIndex = 0
  169.  
  170. End Sub
  171.  
  172.